\(\int \frac {(d+e x^r) (a+b \log (c x^n))}{x} \, dx\) [370]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 21, antiderivative size = 53 \[ \int \frac {\left (d+e x^r\right ) \left (a+b \log \left (c x^n\right )\right )}{x} \, dx=-\frac {b e n x^r}{r^2}+\frac {e x^r \left (a+b \log \left (c x^n\right )\right )}{r}+\frac {d \left (a+b \log \left (c x^n\right )\right )^2}{2 b n} \]

[Out]

-b*e*n*x^r/r^2+e*x^r*(a+b*ln(c*x^n))/r+1/2*d*(a+b*ln(c*x^n))^2/b/n

Rubi [A] (verified)

Time = 0.06 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {14, 2393, 2338, 2341} \[ \int \frac {\left (d+e x^r\right ) \left (a+b \log \left (c x^n\right )\right )}{x} \, dx=\frac {d \left (a+b \log \left (c x^n\right )\right )^2}{2 b n}+\frac {e x^r \left (a+b \log \left (c x^n\right )\right )}{r}-\frac {b e n x^r}{r^2} \]

[In]

Int[((d + e*x^r)*(a + b*Log[c*x^n]))/x,x]

[Out]

-((b*e*n*x^r)/r^2) + (e*x^r*(a + b*Log[c*x^n]))/r + (d*(a + b*Log[c*x^n])^2)/(2*b*n)

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 2338

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))/(x_), x_Symbol] :> Simp[(a + b*Log[c*x^n])^2/(2*b*n), x] /; FreeQ[{a
, b, c, n}, x]

Rule 2341

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Log[c*x^
n])/(d*(m + 1))), x] - Simp[b*n*((d*x)^(m + 1)/(d*(m + 1)^2)), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1
]

Rule 2393

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((f_.)*(x_))^(m_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol] :> Wit
h[{u = ExpandIntegrand[a + b*Log[c*x^n], (f*x)^m*(d + e*x^r)^q, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[{a, b, c,
d, e, f, m, n, q, r}, x] && IntegerQ[q] && (GtQ[q, 0] || (IntegerQ[m] && IntegerQ[r]))

Rubi steps \begin{align*} \text {integral}& = \int \left (\frac {d \left (a+b \log \left (c x^n\right )\right )}{x}+e x^{-1+r} \left (a+b \log \left (c x^n\right )\right )\right ) \, dx \\ & = d \int \frac {a+b \log \left (c x^n\right )}{x} \, dx+e \int x^{-1+r} \left (a+b \log \left (c x^n\right )\right ) \, dx \\ & = -\frac {b e n x^r}{r^2}+\frac {e x^r \left (a+b \log \left (c x^n\right )\right )}{r}+\frac {d \left (a+b \log \left (c x^n\right )\right )^2}{2 b n} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.06 (sec) , antiderivative size = 54, normalized size of antiderivative = 1.02 \[ \int \frac {\left (d+e x^r\right ) \left (a+b \log \left (c x^n\right )\right )}{x} \, dx=\frac {e (-b n+a r) x^r}{r^2}+a d \log (x)+\frac {b e x^r \log \left (c x^n\right )}{r}+\frac {b d \log ^2\left (c x^n\right )}{2 n} \]

[In]

Integrate[((d + e*x^r)*(a + b*Log[c*x^n]))/x,x]

[Out]

(e*(-(b*n) + a*r)*x^r)/r^2 + a*d*Log[x] + (b*e*x^r*Log[c*x^n])/r + (b*d*Log[c*x^n]^2)/(2*n)

Maple [A] (verified)

Time = 0.22 (sec) , antiderivative size = 68, normalized size of antiderivative = 1.28

method result size
parallelrisch \(\frac {2 \ln \left (x \right ) a d n \,r^{2}+2 x^{r} \ln \left (c \,x^{n}\right ) b e r n +b d \ln \left (c \,x^{n}\right )^{2} r^{2}+2 x^{r} a e n r -2 x^{r} b e \,n^{2}}{2 r^{2} n}\) \(68\)
risch \(\frac {b \left (d r \ln \left (x \right )+e \,x^{r}\right ) \ln \left (x^{n}\right )}{r}-\frac {i \ln \left (x \right ) \pi b d \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )}{2}+\frac {i \ln \left (x \right ) \pi b d \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}}{2}+\frac {i \ln \left (x \right ) \pi b d \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}}{2}-\frac {i \ln \left (x \right ) \pi b d \operatorname {csgn}\left (i c \,x^{n}\right )^{3}}{2}-\frac {i \pi b e \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right ) x^{r}}{2 r}+\frac {i \pi b e \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2} x^{r}}{2 r}+\frac {i \pi b e \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2} x^{r}}{2 r}-\frac {i \pi b e \operatorname {csgn}\left (i c \,x^{n}\right )^{3} x^{r}}{2 r}-\frac {b d n \ln \left (x \right )^{2}}{2}+\ln \left (x \right ) \ln \left (c \right ) b d +\frac {\ln \left (c \right ) b e \,x^{r}}{r}+\ln \left (x \right ) a d +\frac {x^{r} a e}{r}-\frac {b e n \,x^{r}}{r^{2}}\) \(278\)

[In]

int((d+e*x^r)*(a+b*ln(c*x^n))/x,x,method=_RETURNVERBOSE)

[Out]

1/2*(2*ln(x)*a*d*n*r^2+2*x^r*ln(c*x^n)*b*e*r*n+b*d*ln(c*x^n)^2*r^2+2*x^r*a*e*n*r-2*x^r*b*e*n^2)/r^2/n

Fricas [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 64, normalized size of antiderivative = 1.21 \[ \int \frac {\left (d+e x^r\right ) \left (a+b \log \left (c x^n\right )\right )}{x} \, dx=\frac {b d n r^{2} \log \left (x\right )^{2} + 2 \, {\left (b e n r \log \left (x\right ) + b e r \log \left (c\right ) - b e n + a e r\right )} x^{r} + 2 \, {\left (b d r^{2} \log \left (c\right ) + a d r^{2}\right )} \log \left (x\right )}{2 \, r^{2}} \]

[In]

integrate((d+e*x^r)*(a+b*log(c*x^n))/x,x, algorithm="fricas")

[Out]

1/2*(b*d*n*r^2*log(x)^2 + 2*(b*e*n*r*log(x) + b*e*r*log(c) - b*e*n + a*e*r)*x^r + 2*(b*d*r^2*log(c) + a*d*r^2)
*log(x))/r^2

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 131 vs. \(2 (46) = 92\).

Time = 2.28 (sec) , antiderivative size = 131, normalized size of antiderivative = 2.47 \[ \int \frac {\left (d+e x^r\right ) \left (a+b \log \left (c x^n\right )\right )}{x} \, dx=\begin {cases} \left (a + b \log {\left (c \right )}\right ) \left (d + e\right ) \log {\left (x \right )} & \text {for}\: n = 0 \wedge r = 0 \\\left (a + b \log {\left (c \right )}\right ) \left (d \log {\left (x \right )} + \frac {e x^{r}}{r}\right ) & \text {for}\: n = 0 \\\left (d + e\right ) \left (\begin {cases} a \log {\left (x \right )} & \text {for}\: b = 0 \\- \left (- a - b \log {\left (c \right )}\right ) \log {\left (x \right )} & \text {for}\: n = 0 \\\frac {\left (- a - b \log {\left (c x^{n} \right )}\right )^{2}}{2 b n} & \text {otherwise} \end {cases}\right ) & \text {for}\: r = 0 \\\frac {a d \log {\left (c x^{n} \right )}}{n} + \frac {a e x^{r}}{r} + \frac {b d \log {\left (c x^{n} \right )}^{2}}{2 n} - \frac {b e n x^{r}}{r^{2}} + \frac {b e x^{r} \log {\left (c x^{n} \right )}}{r} & \text {otherwise} \end {cases} \]

[In]

integrate((d+e*x**r)*(a+b*ln(c*x**n))/x,x)

[Out]

Piecewise(((a + b*log(c))*(d + e)*log(x), Eq(n, 0) & Eq(r, 0)), ((a + b*log(c))*(d*log(x) + e*x**r/r), Eq(n, 0
)), ((d + e)*Piecewise((a*log(x), Eq(b, 0)), (-(-a - b*log(c))*log(x), Eq(n, 0)), ((-a - b*log(c*x**n))**2/(2*
b*n), True)), Eq(r, 0)), (a*d*log(c*x**n)/n + a*e*x**r/r + b*d*log(c*x**n)**2/(2*n) - b*e*n*x**r/r**2 + b*e*x*
*r*log(c*x**n)/r, True))

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 56, normalized size of antiderivative = 1.06 \[ \int \frac {\left (d+e x^r\right ) \left (a+b \log \left (c x^n\right )\right )}{x} \, dx=\frac {b e x^{r} \log \left (c x^{n}\right )}{r} + \frac {b d \log \left (c x^{n}\right )^{2}}{2 \, n} + a d \log \left (x\right ) - \frac {b e n x^{r}}{r^{2}} + \frac {a e x^{r}}{r} \]

[In]

integrate((d+e*x^r)*(a+b*log(c*x^n))/x,x, algorithm="maxima")

[Out]

b*e*x^r*log(c*x^n)/r + 1/2*b*d*log(c*x^n)^2/n + a*d*log(x) - b*e*n*x^r/r^2 + a*e*x^r/r

Giac [F]

\[ \int \frac {\left (d+e x^r\right ) \left (a+b \log \left (c x^n\right )\right )}{x} \, dx=\int { \frac {{\left (e x^{r} + d\right )} {\left (b \log \left (c x^{n}\right ) + a\right )}}{x} \,d x } \]

[In]

integrate((d+e*x^r)*(a+b*log(c*x^n))/x,x, algorithm="giac")

[Out]

integrate((e*x^r + d)*(b*log(c*x^n) + a)/x, x)

Mupad [F(-1)]

Timed out. \[ \int \frac {\left (d+e x^r\right ) \left (a+b \log \left (c x^n\right )\right )}{x} \, dx=\int \frac {\left (d+e\,x^r\right )\,\left (a+b\,\ln \left (c\,x^n\right )\right )}{x} \,d x \]

[In]

int(((d + e*x^r)*(a + b*log(c*x^n)))/x,x)

[Out]

int(((d + e*x^r)*(a + b*log(c*x^n)))/x, x)